﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuestionView.aspx.cs" Inherits="YiShi.Question.QuestionView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" href="/css/redmond/common.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/redmond/jquery-ui-1.8.18.custom.css" type="text/css"
        media="all" />

    <script type="text/javascript" src="/scripts/jquery-1.7.1.min.js"></script>

    <script type="text/javascript" src="/scripts/jquery-ui-1.8.18.custom.min.js"></script>

    <script type="text/javascript" src="/scripts/common.js"></script>

</head>
<body style="font-size: 9pt;">
    <div align="center">
        <div>
            <table style="width: 600px; border-collapse: collapse; background-color: #d0e5f5;"
                class="single-border">
                <tr class="table-body" align="left">
                    <td>
                        <table style="width: 100%; border-collapse: collapse;" class="single-border">
                            <tr style="height: 29px;">
                                <td align="left" class="single-border" id="TypeTd">
                                    <%=questionType%>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div style="font-weight:normal;color:Black;overflow: auto; text-align: left; width: 100%; background-color: White;">
                                        <%=questionBody%></div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div id="GuideBody" style="font-weight:normal;color:Black;overflow: auto; text-align: left; width: 100%; background-color: White;">
                                        <%=guideBody%></div>
                                </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <button id="Ok" guideid="<%=guideId %>">
                                        确定</button>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>

    <script language="javascript">
        $(function event() {
            $("#Ok").click(function() {
                var answers = $("[name='Answer']");
                var answer = "";
                for (var i = 0; i < answers.length; i++) {
                    var $ele = $(answers[i]);
                    if ($.trim($ele.val()) == "") {
                        Alert("请填写答案！");
                        return;
                    }
                    answer += $.trim($ele.val()) + ",";
                }
                answer = answer.substring(0, answer.length - 1);

                ShowMask();
                var guideid = $(this).attr("guideid");
                $.post("QuestionView.aspx", { ActionType: "Next", GuideId: guideid, Answer: answer }, function(data) {
                    HideMask();
                    if (data.IsSuccess == "true") {
                        Alert(data.Tip, function() {
                            if (data.IsOver == "true")
                                window.close();
                            else {
                                if (data.IsNewGuide == "true") {
                                    $("#GuideBody").html(unescape(data.GuideBody));
                                    $("#Ok").attr("guideid", data.GuideId);
                                }
                            }
                        });
                    }
                    else
                        ShowError(data.Message, data.Source, data.StackTrace);
                }, "json");

            });
        }); 
    </script>

</body>
</html>
